<% includeFileTemplate("../_header.html"){} %>

<body>
<% includeFileTemplate("../_navbar.html"){} %>
<br><br>
<div class="container">

 <img src="${request.ContextPath}/images/8.jpg"class="img-responsive "  >
  <form class="form-signin" role="form" id="formID">
  <h3 class="text-center">上墙须知</h3>
    <ul>
		<li>上墙信息必须本人亲自填写，不能朋友代笔。。</li>
		
		<li>认证地点：1314俱乐部（芝罘区万达金街B2-219）</li>
		
		<li>网络交友仍存在风险，谨防诈骗</li>
		
	    <li>“ * ”代表认证信息，他人无法查看</li>
	    <li>已有帐号<a href="${request.ContextPath}/login">请登录</a></li>
	</ul>
	<div class="alert alert-warning alert-dismissible fade in" role="alert">
      <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
      <strong> ${errstr}</strong>
    </div>
	<div class="form-group has-error has-feedback">
		<input type="text" class="form-control" name="username" placeholder="* 请输入手机号" required="required"  autofocus="autofocus">
	</div>
    <div class="form-group has-error has-feedback">
		<input type="password" class="form-control" name="password"placeholder="* 请输入密码" required="required">
	</div>
    <div class="form-group has-error has-feedback">
		<input type="text" class="form-control" name="real_name"placeholder="* 请输入姓名" required="required">
	</div>
	<div class="form-group has-error has-feedback">
		<input type="text" class="form-control" name="card"placeholder="* 请输入身份证号 " required="required">
	</div>
	<div class="form-group  has-success has-feedback">
		<input type="text" class="form-control" name="short_name"placeholder="昵称" required >
	</div>
	 <div class="has-success">
	  	<label for="dtp_input" class="col-md-2 control-label">性别</label>
		  <div class="checkbox">
		    <label>
		      <input type="radio"  name="sex"   checked="checked" value="男">
		      男
		    </label>
		    <label>
		      <input type="radio"  name="sex" value="女">
		      女
		    </label>
		  </div>
		</div>
			<div class="form-group has-success has-feedback">
                <label for="dtp_input2" class="col-md-2 control-label">身高</label>
			  <div class="input-group">
				  <input type="text" class="form-control" name="high">
				  <span class="input-group-addon">cm</span>
				</div>
				</div>
				<div class="form-group has-success has-feedback">
                <label for="dtp_input2" class="col-md-2 control-label">体重</label>
			  <div class="input-group">
				  <input type="text" class="form-control" name="weight">
				  <span class="input-group-addon">kg</span>
				</div>
				</div>
			  <div class="form-group has-success has-feedback">
                <label for="dtp_input2" class="col-md-2 control-label">出生年月</label>
                <div class="input-group date form_date col-md-5" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                    <input class="form-control" size="16" type="text"   value="" readonly>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
					<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
				<input type="hidden" id="dtp_input2"  name="birthday" value="" /><br/>
            </div>
            <div class="has-success">
            <label for="dtp_input" class="col-md-2 control-label">房</label>
				  <div class="checkbox">
				    <label>
				      <input type="radio"  name="fang"   checked="checked" value="无">
				      无
				    </label>
				    <label>
				      <input type="radio"  name="fang" value="有">
				       有
				    </label>
				  </div>
				</div>
				<div class="has-success">
				<label for="dtp_input2" class="col-md-2 control-label">车</label>
				  <div class="checkbox">
				    <label>
				      <input type="radio"  name="che"   checked="checked" value="无">
				      无
				    </label>
				    <label>
				      <input type="radio"  name="che" value="有">
				      有
				    </label>
				  </div>
				</div>
          <div class="form-group  has-success has-feedback">
    			 <input type="text"   class="form-control" name ="education"  placeholder="学历/学校" >
		  </div>
		  <div class="form-group  has-success has-feedback">
   			 <input type="text"   class="form-control" name ="hometown"  placeholder="家乡" >
		  </div>
		  <div class="form-group  has-success has-feedback">
   			 <input type="text"   class="form-control" name ="work"  placeholder="职业" >
		  </div>
		  <div class="form-group  has-success has-feedback">
   			 <input type="text"   class="form-control" name ="workaddr"  placeholder="工作地区">
		  </div>
		  <div class="form-group  has-success has-feedback">
		  <label class="control-label"  >自我简介</label>
		     <textarea class="form-control" rows="3" name ="myself" ></textarea>
		  </div>
		   <div class="form-group  has-success has-feedback">
		     <label class="control-label"  >交友要求</label>
		     <textarea class="form-control" rows="3" name ="others"></textarea>
		  </div>
		  <div class="form-group  has-success has-feedback">
   			 <input type="text"   class="form-control" name ="push"  placeholder="推荐人（ID）">
		  </div>
		  <div class="form-group has-success has-feedback">
		     <label for="top">头像</label>
		     <span class="btn btn-success fileinput-button">
		     	<i class="glyphicon glyphicon-picture"></i>
           		<span>选择</span>
		     	<input id="top_up"  type="file"  name="upfile">
		     </span>
   			 <input class="form-control"  type="hidden"  name="top"  id="top_value" readonly>
		  </div>
		  <div>
		   <div id="top_pic"></div>
		  </div>	
	
    	<input class="btn btn-lg btn-primary btn-block" type="button" id="sub" value=" 立即注册 ">
    <br>
  </form>
  
  
</div>

</body>
<% includeFileTemplate("../_footer.html"){} %>
<script type="text/javascript">
$(function() {
	$("#sub").bind("click",function(){
		var urlPost="${request.ContextPath}/register/doregister";
		$.ajax({
			type:"POST",
			url:urlPost,
			data:$("#formID").serialize(),
			success:function(data){
				console.info(data);
				if(data.statusCode == 200){
					location.href="${request.ContextPath}/register/success?id="+data.message;
				}else{
					alert(data.message);
				}
			},
			error:function(data){
				console.info(data);
			}
		})
	})
		
	
	var uploadUrl = '${request.ContextPath}/public/uploads';
	$('#top_up').fileupload({
	        url: uploadUrl,
	        dataType: 'json',
	        done: function (e, data) {
	        	console.info('result'+data.result.msg);
	        	
	            $('#top_value').attr("value",data.result.msg);
	            $('#top_pic').html("<img class='img-rounded img-responsive' style='height:200px' src='${request.ContextPath}/"+data.result.msg+"' >");
	            
	        },
	        progressall: function (e, data) {
	        	 
	        }
	    });
	
	$('.form_date').datetimepicker({
		format: "yyyy-MM-dd ",
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0
    });
	
});
</script>
</html>